<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<title>进货管理 - 物流管理系统</title>
	<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
	<style media="all" type="text/css">
		@import "../../style/all.css";
		@import "../../style/jquery/ui.all.css";
	</style>
	<script type="text/javascript" src="../../script/jquery-1.3.2.min.js"></script>
	<script type="text/javascript" src="../../script/jquery-ui-personalized-1.6rc6.min.js"></script>
	<script type="text/javascript" src="../../script/date.js"></script>
	<script type="text/javascript" src="../../script/common.js"></script>
	<script type="text/javascript">
		function validateStock(){
			to('validate_stock.html');
		}
		$(function(){
			//设置日期控件
			datepicker('.date-two');
		});
	</script>	
	<script type="text/javascript">
   $(function(){   
	   $("#btn1").click(function(){
		   window.location.href="../proapi/getprobyid?tex1="+$("#tex1").attr("value")+"&tex2="+$("#tex2").attr("value")+"&tex3="+$("#tex3").attr("value");
	   });	
   })
    </script>
</head>
<body style="background: none">
	<div class="top-bar">
		<h1>进货安排</h1>
		<div class="breadcrumbs">
			<div class="button-bar">
				<input type="button" name="Submit" value="帮助" class="button"/>
				<input type="button" name="Submit" value="查询" class="button"/>
			</div>
			<a href="../../index.html" target="_top">首页</a> /
			<a href="../index.html" target="_top">配送中心</a>
		</div>
	</div>
	<div class="select-bar">
		   			<table class="select-table">
				<tr>
					<th>商品代号</th>
					<td><input type="text" name="textfield" class="text"/></td>
					<th>商品名称</th>
					<td><input type="text" name="textfield" class="text"/></td>
				</tr>
			</table>
	 </div>
	<div class="table">
		<img src="../../style/img/bg-th-left.gif" width="8" height="7" alt="" class="left" />
		<img src="../../style/img/bg-th-right.gif" width="7" height="7" alt="" class="right" />
		<table class="listing form" cellpadding="0" cellspacing="0">
			<tr>
				<th class="first">序号</th>
                <th>商品代号</th>
				<th>商品名称</th>
				<th>现有库存量</th>
				<th>预警库存量</th>
				<th>计量单位</th>
				<th>进货量</th>
				<th>进货时间</th>
				<th class="last">操作</th>
			</tr>
			<c:forEach items="${listpro}" var="listpro">
            <tr>
				<td class="first">${listpro.productid}</td>
				<td>${listpro.productid}<div style="display: none;"><input type="text" name="textfield" class="text" size="2" id="tex3"  value="${listpro.productid}"/></div></td>
				<td>${listpro.productname}</td>
				<td>${listpro.kucount}</td>
				<td>50</td>
                <td>${listpro.unit}</td>
				<td><input type="text" name="textfield" class="text" size="2" id="tex1"  value=""/></td>
				<td><input type="text" name="textfield" class="date-two text" id="tex2" value=""/></td>
				<td><input type="submit" id="btn1" value="" style="background: url('../../style/img/stock-ico.gif'); width: 10px"></td>
			</tr>
			</c:forEach>
		</table>
		<div class='pager'>
		       每页<input type="text" class="text" size="2" value="6"/>条
			第${pageIndex}页/共${totalPage}页
			<a href="<%=basePath%>/proapi/getprobypage?pageIndex=1&path=<%=request.getServletPath()   %>">第一页</a>
			<a href="<%=basePath%>/proapi/getprobypage?pageIndex=${pageIndex==1?1:pageIndex-1 }&path=<%=request.getServletPath()   %>">上一页</a>
			<c:forEach var="i" begin="1" end="${totalPage}">
	        <c:choose>
				<c:when test="${i==pageIndex}">
					<button onclick="javascript:window.location=<%=basePath%>/proapi/getprobypage?pageIndex=${i}&path=<%=request.getServletPath()   %>">${i}</button>
				</c:when>
				<c:otherwise>
					<a href="<%=basePath%>/proapi/getprobypage?pageIndex=${i}&path=<%=request.getServletPath()   %>">${i}</a>
				</c:otherwise>
		     </c:choose>
	      </c:forEach>
			<a href="<%=basePath%>/proapi/getprobypage?pageIndex=${pageIndex==totalPage?totalPage:pageIndex+1}&path=<%=request.getServletPath()%>">下一页</a>
			<a href="<%=basePath%>/proapi/getprobypage?pageIndex=${totalPage }&path=<%=request.getServletPath()   %>">最后一页</a>
        </div>
	</div>
</body>
</html>
